package cn.zhangxin.pethome.system.menu.mapper;

import cn.zhangxin.pethome.system.menu.domain.Menu;
import cn.zhangxin.pethome.base.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zx
 * @since 2023-02-01
 */
@Repository
public interface MenuMapper extends BaseMapper<Menu> {
    //获得父级菜单
    List<Menu> getParentName();
    //查询最大索引
    Integer getIndexMax(Long parentId);
    //通过父级菜单id查询对象
    List<Menu> findAllByParentId(Long parentId);
    //根据角色菜单中间表查询菜单
    List<Menu> findAllByRoleId(Long RoleId);
    //根据employeeId查询员工的菜单
    List<Menu> findAllByEmployeeId(Long employeeId);
    //菜单树
    List<Long> findMenuByRoleIds(List<Long> roles);
}
